package com.ruoyi.common.enums;

import lombok.Getter;

import java.util.concurrent.TimeUnit;

/**
 * 定义redis key
 */
@Getter
public enum RedisKeyEnum {

    LOGIN_TOKEN("member:loginToken:", "登录token", null, TimeUnit.DAYS),
    USER_INFO("member:user:info:", "用户信息", 30, TimeUnit.DAYS),
    CMS_MODEL_LIKE_COUNT("cms:model:like:count:", "模型点赞总数", 365, TimeUnit.DAYS),
    CMS_MODEL_LIKE_USER("cms:model:like:user:", "用户模型点赞列表", 365, TimeUnit.DAYS),
    CMS_MODEL_INTRODUCTION("cms:model:introduction:", "模型简介", 30, TimeUnit.DAYS),
    CMS_MODEL_FAVORITE_COUNT("cms:model:favorite:count:", "模型收藏总数", 365, TimeUnit.DAYS),
    CMS_MODEL_FAVORITE_USER("cms:model:favorite:user:", "用户模型收藏列表", 365, TimeUnit.DAYS),
    CMS_MODEL_PARAMETER("cms:model:parameter:", "模型参数", 365, TimeUnit.DAYS),
    ;

    private final String prefix;
    private final String desc;
    private final Integer timeout;
    private final TimeUnit timeUnit;

    RedisKeyEnum(String prefix, String desc, Integer timeout, TimeUnit timeUnit) {
        this.prefix = prefix;
        this.desc = desc;
        this.timeout = timeout;
        this.timeUnit = timeUnit;
    }

}
